import request from "./request"
//添加地址
export const addaddress = (data) =>{
    return request({
      method: 'post',
      url: 'mall/receiver/add',
      data,
      dataType: "json",
      headers:{
        token:`${localStorage.getItem('token')}`
      }
    })
  }
//查看地址
export const showaddress = ()=>{
    return request({
      method: 'get',
      url: 'mall/receiver/item',
      headers:{
        token:`${localStorage.getItem('token')}`
      }
    })
  }
//修改收货地址
export const updateaddress = (data) =>{
    return request({
      method: 'post',
      url: 'mall/receiver/updateAddress',
      data,
      dataType: "json",
      headers:{
        token:`${localStorage.getItem('token')}`
      }
    })
  }
//删除当前地址
export const deleteaddress = (id) =>{
    return request({
      method: 'post',
      url: 'mall/receiver/deleteAddress',
      params:{id},
      // dataType: "json",
      headers:{
        token:`${localStorage.getItem('token')}`
      }
    })
  }